package demo2;

//牛客网:组队竞赛
import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long[] arr = new long[n*3];
        for(int i = 0; i<n*3; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long sum = 0;
        int l = 0, r = n*3-1;
        while(l<r) {
            sum += arr[r-1];
            l++;
            r-=2;
        }
        System.out.println(sum);
    }
}

/*

2
5 2 8 5 1 5
1 2 5 5 5 8 9 10 11
1 10 11
2 5 5
5 8 9

1 2 3 4 5 6 7 8 9
1 8 9
2 6 7
3 4 5

*/